# Contributor: Kiyoshi Aman <kiyoshi.aman@gmail.com>
# Maintainer: Kiyoshi Aman <kiyoshi.aman@gmail.com>
pkgname=perl-http-message
_pkgreal=HTTP-Message
pkgver=6.25
pkgrel=0
pkgdesc="HTTP style messages"
url="https://metacpan.org/release/HTTP-Message"
arch="noarch"
license="GPL-1.0-or-later OR Artistic-1.0-Perl"
depends="perl perl-lwp-mediatypes perl-encode-locale perl-http-date perl-uri
	perl-io-html"
makedepends="perl-dev"
checkdepends="perl-try-tiny"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/E/ET/ETHER/HTTP-Message-$pkgver.tar.gz"

builddir="$srcdir/$_pkgreal-$pkgver"

prepare() {
	default_prepare

	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
}

build() {
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	make
}

check() {
	make test
}

package() {
	make DESTDIR="$pkgdir" install
	find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
}

sha512sums="db0dbb080c766c22dbb27af45f38bb6567526eac854e74c3e107ba2a491179445a8e0c0ab608c7a6daa3ee672df9a89035fc835e04e58aeb58d6362c3ab21f4d  HTTP-Message-6.25.tar.gz"
